from logging import getLogger
from urllib2 import urlopen



log = getLogger('meercat.ui.client.rest')

class Rest(object):
    def __init__(self, url):
        self._url = url.rstrip('/')
    
    def get(self, identifier):
        url = '%s/%s/' % (self._url,
                          str(identifier).replace('/','_'),)
        
        log.debug('%s.get(%s) url: %s' % (str(self), str(identifier), url,))
        
        return urlopen(url)
    